#ifndef SIPB2BSESSION_HPP__
#define SIPB2BSESSION_HPP__

#include <map>
#include "resip/stack/SipMessage.hxx"
#include "SipGDServiceConfigure.hpp"
#include "SipSessionBase.hpp"

using namespace resip;

namespace wtsip{

//class CSipB2BSession;

//class WTGD_SIPSRV_PUBLIC CSipB2BSessionHandle{
//public:
//    virtual bool canB2BRequest(SipMessage& msg, CSipSessionBase& s, CSipB2BSession& b2b) = 0;
//    
//    virtual bool onDestroy(CSipB2BSession& b2b) = 0;
//};


class WTGD_SIPSRV_PUBLIC CSipB2BSession: virtual public CSipSessionHandle
{
public:

    CSipB2BSession(CSipGDService& srv, CSipSessionBase& caller, CSipSessionBase& callee);

    virtual ~CSipB2BSession();

    /*virtual bool registerB2BHandle(CSipB2BSessionHandle* handle);

    virtual bool unregisterB2BHandle();    */

    virtual bool startCaller(SipMessage& calleeReq) = 0;

protected:

    virtual bool destroy();

    /*virtual bool onSuccess(SipMessage& msg, CSipSessionBase& sb);

    virtual bool onFailed(SipMessage& msg, CSipSessionBase& sb);

    virtual bool onTrying(SipMessage& msg, CSipSessionBase& sb);

    virtual bool onDestroy(CSipSessionBase& sb);*/

protected:

    int m_destroyCounter;

    //CSipB2BSessionHandle* m_handle;
    
    CSipSessionBase& m_caller;

    CSipSessionBase& m_callee;

    CSipGDService& m_service;

    //std::map<resip::Data, resip::Data> m_TransMap;
};



}//namespace

#endif


